package org.client.iot.ui.device.monitorDataFragment;

import static org.client.iot.constant.GlobeConstant.MonitorData.*;

import android.os.Bundle;

import android.view.View;
import org.client.iot.databinding.FragmentMonitorDataListBinding;
import org.client.iot.ui.device.MonitorDataActivity;
import org.tzw.template.base.BaseFragment;


public class MonitorDataListFragment extends BaseFragment<FragmentMonitorDataListBinding> implements MonitorDataActivity.TimeRangeUpdatable {
    public static MonitorDataListFragment newInstance(String startDate, String endDate) {
        MonitorDataListFragment fragment = new MonitorDataListFragment();
        Bundle args = new Bundle();
        args.putString(ARG_START_DATE, startDate);
        args.putString(ARG_END_DATE, endDate);
        fragment.setArguments(args);
        return fragment;
    }

    @Override
    protected void initData(View view) {
        Bundle args = getArguments();
        if (args != null) {
            String startDate = args.getString(ARG_START_DATE);
            String endDate = args.getString(ARG_END_DATE);
            // 使用时间参数加载数据
        }
    }
    @Override
    protected void initView(View view) {

    }

    @Override
    public void updateTimeRange(String startDate, String endDate) {

    }

    @Override
    protected void initListener() {

    }

    private void setupRecyclerView() {
        // 设置列表点击监听
//        adapter.setOnItemClickListener(data -> {
//            MonitorDataDetailFragment detailFragment = MonitorDataDetailFragment.newInstance(data);
//            requireActivity().getSupportFragmentManager().beginTransaction()
//                    .replace(R.id.frame_layout_monitor_container, detailFragment)
//                    .addToBackStack(null)
//                    .commit();
//        });
    }
}